import 'package:flutter/material.dart';
import 'package:flutter/cupertino.dart';

class HomeAbout extends StatelessWidget {
  static const String routerName = "/about";
  @override
  Widget build(BuildContext context) {
    final message = ModalRoute.of(context).settings.arguments as String;
    return WillPopScope(
      onWillPop: () {
        _backHome(context);
        return Future.value(false);
      },
      child: Scaffold(
        appBar: AppBar(
          title: Text("关于页"),
        ),
        body: CupertinoPageScaffold(
          child: Center(
            child: Column(
              mainAxisAlignment: MainAxisAlignment.center,
              children: <Widget>[
                Text(message??"message"),
                RaisedButton(
                  child: Text("返回首页"),
                  onPressed: () {
                    _backHome(context);
                  },
                )
              ],
            ),
          ),
        ),
      ),
    );
  }

  void _backHome(BuildContext context) {
    Navigator.of(context).pop("about pop message");
  }
}
